﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Method.Enum
{
    /// <summary>
    /// 根据下标获取值
    /// </summary>
    public static class GetEnumValueByIndex
    {
        public static string GetName<T>(int index) where T : System.Enum
        {
            var enumList = typeof(T);
            var enumVlaues = enumList.GetEnumValues();
            return enumVlaues.GetValue(index).ToString();
        }
    }
}
